package zuoye;

public class SeqList {
    private final int MAX = 100;
    private Object[] arr =  new Object[MAX];
    public int len = 0;


    //插入
    public void insert( Student date){
        arr[len] = date;
        len++;
    }

    //获取数组个数
    public int getCount(){
        return len;
    }
    //逆序
    public void reverse(){
    for(int i=0; i<len/2;i++){
        Object team = arr[i];
        arr[i] = arr[len-1-i];
        arr[len-1-i] = team;
    }
    }



    //输出数组内容

    public Student top(int len) {
        return (Student) arr[len];
    }

    //打印
    public void display(){
        if(len==0){
            System.out.println("此表为空");
            return;
        }

        for(int i=0;i<len;i++){
            System.out.print(arr[i] +"  ");
        }
        System.out.println();
    }
}
